import { createRouter as create } from "vue-router";
// 路由写法和平常有差异，平常固定history，可以直接写history，但是为了兼容ssr，需要传入一个history对象

function createRouter(history) {
  const routers = create({
    history,
    routes: [
      {
        path: "/",
        name: "ahome",
        component: () => import("../views/ahome.vue"),
      },
      {
        path: "/about",
        name: "about",
        component: () => import("../views/about.vue"),
      },
    ],
  });
  return routers;
}

export default createRouter;
